package fr.umlv.ig.metroView.confView;

import javax.swing.JScrollPane;
import javax.swing.JTree;

import fr.umlv.ig.adapter.StationTreeModel;
import fr.umlv.ig.listenerFactory.StationTreeListenerFactory;
import fr.umlv.ig.model.MetroModelImpl;

public class TreeStationConfView {

	
	public static JScrollPane getTreeStationPanel(MetroModelImpl model) {
		final StationTreeModel treeModel = new StationTreeModel(model);
		final JTree jtree = new JTree(treeModel);
		jtree.setRootVisible(false);
		
		jtree.addTreeSelectionListener(StationTreeListenerFactory.getSelectionListener(jtree));
		jtree.addMouseListener(StationTreeListenerFactory.getMouseAdapter(jtree));
		jtree.setCellRenderer(StationTreeListenerFactory.getTreeCellRenderer(treeModel));
		
		
		
		JScrollPane pane = new JScrollPane(jtree);
		return pane;
	}
	


	

}
